// ValidationAspects
// Written by Mike Saunders
// Released under Microsoft Public License (Ms-PL)
using System;
using ValidationAspects.Factories;
using ValidationAspects.Sdk;

namespace ValidationAspects
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	public sealed class MinimumLengthAttribute : ValidatorAttribute
	{
		private readonly int _length;

		public MinimumLengthAttribute(int length)
		{
			_length = length;
		}

		#region Overrides of ValidatorAttribute
		public override IValidatorFactory Factory
		{
			get { return new MinimumLength {Length = _length}; }
		}
		#endregion
	}
}